#!/bin/bash
SERVER="localhost:8080"
AUTH="admin:admin"

DIR=backup-$(date +"%Y%m%d-%H%M%S")
mkdir -p $DIR

for db in config users areas gateways multicast_channels networks groups profiles devices nodes ignored_nodes handlers connectors; do
    curl --digest -u $AUTH --output $DIR/$db.json http://$SERVER/api/$db
done
